package com.cll.prototype.common.util;

import org.apache.commons.lang3.StringUtils;

/**
 * 描述信息:
 * 正则表达式校验工具类
 * @author CLL
 * @version 1.0
 * @date 2020/10/26 17:33
 */
public class ValidateUtils {

    /**
     * 邮箱正则校验
     */
    private static final String EMAIL_REGEXP_STR = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";

    public static boolean checkEmailAddress(String email){
        if (StringUtils.isBlank(email)) {
            return false;
        }
        return email.matches(EMAIL_REGEXP_STR);
    }

}
